package com.itshare.video.common.crud;


import com.github.pagehelper.PageHelper;

import java.util.List;

/**
 * 这个接口未来将用于自己的代码模板
 * @Author lyr
 * @create 2020/9/16 21:00
 */
@Deprecated
public abstract class BaseServiceImpl<PO,POExample,ID> implements BaseService<PO,POExample,ID> {
    public abstract BaseMapper<PO,POExample,ID> getMapper();
    @Override
    public int deleteByExample(POExample poExample) {
        return getMapper().deleteByExample(poExample);
    }

    @Override
    public long countByExample(POExample poExample) {
        return getMapper().countByExample(poExample);
    }

    @Override
    public int deleteByPrimaryKey(ID primaryKey) {
        return getMapper().deleteByPrimaryKey(primaryKey);
    }

    @Override
    public int insert(PO record) {
        return getMapper().insert(record);
    }

    @Override
    public int insertSelective(PO record) {
        return getMapper().insertSelective(record);
    }

    @Override
    public PO selectByPrimaryKey(ID pk) {
        return getMapper().selectByPrimaryKey(pk);
    }

    @Override
    public List<PO> selectByExampleForPage(POExample poExample, Integer page, Integer size) {
        PageHelper.startPage(page,size);
        return getMapper().selectByExample(poExample);
    }

    @Override
    public List<PO> selectByExample(POExample poExample) {
        return getMapper().selectByExample(poExample);
    }

    @Override
    public int updateByPrimaryKeySelective(PO record) {
        return getMapper().updateByPrimaryKeySelective(record);
    }

    @Override
    public int updateByPrimaryKey(PO record) {
        return getMapper().updateByPrimaryKey(record);
    }

    @Override
    public int updateByExampleSelective(PO record, POExample poExample) {
        return getMapper().updateByExampleSelective(record,poExample);
    }

    @Override
    public int updateByExample(PO record, POExample poExample) {
        return getMapper().updateByExample(record,poExample);
    }
}
